<?php

declare (strict_types = 1);
namespace app\admin\middleware;


class Before
{
    public function handle($request, \Closure $next)
    {
        //前置中间件
        if(empty(session(config("session.session_admin"))) && !preg_match("/Login/",$request->pathinfo()) ){
            return redirect((string) url('Login/login'));
        }
        $response = $next($request);
        return $response;
    }
}